import re
import util
FALLBACKICON = ('res:/uicore/texture/icons/004_64.dds', 4, 64, 1)
S2D_RFX_COPY = 0
S2D_RFX_FILTER = 1
S2D_RFX_BLUR = 2
S2D_RFX_MODULATE = 3
TR2_SPS_OFF = 0
TR2_SPS_ON = 1
TR2_SPS_CHILDREN = 2
DEVICE_WINDOWED = 1
DEVICE_DEFWIDTH = 1024
DEVICE_DEFHEIGHT = 768
LABELTABMARGIN = 6
LABELFONTSIZE = 10
LABELLINESPACE = 12
LABELLETTERSPACE = 0
WINHEADERFONTSIZE = 10
WINHEADERLETTERSPACE = 0
WINHEADERUPPERCASE = 1
SCROLLVERSION = 3
SPLITLEFT = 0
SPLITTOP = 1
SPLITRIGHT = 2
SPLITBOTTOM = 3
HORIZONTAL = 0
VERTICAL = 1
AUTOPOSNONE = 0
AUTOPOSXCENTER = 1
AUTOPOSYCENTER = 16
AUTOPOSCENTER = 17
MOUSELEFT = 0
MOUSERIGHT = 1
MOUSEMIDDLE = 2
MOUSEXBUTTON1 = 3
MOUSEXBUTTON2 = 4
HTML_ALBASELINE = 0
HTML_ALTOP = 1
HTML_ALMIDDLE = 2
HTML_ALBOTTOM = 3
HTML_ALSUB = 4
HTML_ALSUPER = 5
HTML_BGTILED = 0
HTML_BGSCROLL = 1
HTML_BGFIXED = 2
ID_NONE = 0
ID_OK = 1
ID_CANCEL = 2
ID_YES = 6
ID_NO = 7
ID_CLOSE = 8
ID_HELP = 9
INFO = 0
WARNING = 1
QUESTION = 2
ERROR = 3
FATAL = 4
OK = 0
OKCANCEL = 1
YESNOCANCEL = 2
YESNO = 3
CLOSE = 4
OKCLOSE = 5
UICURSOR_CROSS = 0
UICURSOR_DEFAULT = -1
UICURSOR_DRAGGABLE = 3
UICURSOR_IBEAM = 7
UICURSOR_SELECT = 1
UICURSOR_SELECTDOWN = 2
UICURSOR_TARGET1 = 4
UICURSOR_TARGET2 = 6
UICURSOR_TARGETDOWN = 5
UICURSOR_NONE = 10
UICURSOR_HASMENU = 12
UICURSOR_TOP_RIGHT_BOTTOM_LEFT_DRAG = 13
UICURSOR_TOP_LEFT_BOTTOM_RIGHT_DRAG = 15
UICURSOR_LEFT_RIGHT_DRAG = 16
UICURSOR_TOP_BOTTOM_DRAG = 17
UICURSOR_MAGNIFIER = 23
UICURSOR_CCUPDOWN = 30
UICURSOR_CCLEFTRIGHT = 31
UICURSOR_CCALLDIRECTIONS = 32
UICURSOR_CCSELECTION = 33
UICURSOR_CCHEADTILT = 34
UICURSOR_CCSHOULDERTWIST = 35
UICURSOR_CCHEADALL = 36
UI_ALNONE = 0
UI_ALRIGHT = 2
UI_ALLEFT = 1
UI_ALTOP = 3
UI_ALBOTTOM = 4
UI_ALCLIENT = 5
UI_ALABSOLUTE = 6
UI_ANCHTOP = 1
UI_ANCHLEFT = 2
UI_ANCHRIGHT = 4
UI_ANCHBOTTOM = 8
UI_CONTEXTPOPUP = 111
UI_DBLCLICK = 110
UI_TRIPLECLICK = 112
UI_DEACTIVATE = 9
UI_DESTROY = 3
UI_DRAGDROP = 12
UI_DRAGOVER = 11
UI_ENDDRAG = 13
UI_CREATE = 1
UI_SETPARENT = 4
UI_CLOSE = 6
UI_RESIZE = 7
UI_ACTIVATE = 8
UI_STARTDRAG = 10
UI_MOUSEMOVE = 101
UI_MOUSEWHEEL = 102
UI_MOUSEDOWN = 103
UI_MOUSEUP = 104
UI_MOUSEENTER = 106
UI_MOUSEEXIT = 107
UI_MOUSEHOVER = 108
UI_CLICK = 109
UI_CHAR = 201
UI_KEYDOWN = 202
UI_KEYUP = 203
UI_SETFOCUS = 204
UI_KILLFOCUS = 205
UI_TRACKINGCHANGE = 302
UI_STATECHANGE = 303
UI_ACTIVE = 304
UI_NORMAL = 0
UI_DISABLED = 1
UI_HIDDEN = 2
UI_PICKCHILDREN = 3
ANCH_TOPLEFT = 0
ANCH_CENTERTOP = 1
ANCH_TOPRIGHT = 2
ANCH_CENTERRIGHT = 3
ANCH_BOTTOMLEFT = 4
ANCH_CENTERBOTTOM = 5
ANCH_BOTTOMRIGHT = 6
ANCH_CENTERLEFT = 7
ANCH_CENTER = 8
RELATIVE = 0
TOPLEFT = 0
TOPRIGHT = 1
BOTTOMRIGHT = 2
BOTTOMLEFT = 3
TOLEFT = 4
TOTOP = 5
TORIGHT = 6
TOBOTTOM = 7
TOALL = 8
CENTERLEFT = 9
CENTERRIGHT = 10
CENTERTOP = 11
CENTERBOTTOM = 12
CENTER = 13
ABSOLUTE = 14
FRAME_FILLED_CORNER0 = ('uicore_1_16_161', 7, -2)
FRAME_FILLED_CORNER1 = ('uicore_1_16_162', 7, -2)
FRAME_FILLED_CORNER2 = ('uicore_1_16_163', 7, -2)
FRAME_FILLED_CORNER3 = ('uicore_1_16_164', 7, -2)
FRAME_FILLED_CORNER4 = ('uicore_1_16_165', 7, -2)
FRAME_FILLED_CORNER5 = ('uicore_1_16_166', 7, -2)
FRAME_FILLED_CORNER6 = ('uicore_1_16_167', 7, -2)
FRAME_FILLED_CORNER7 = ('uicore_1_16_168', 7, -2)
FRAME_FILLED_CORNER8 = ('uicore_1_16_169', 7, -2)
FRAME_FILLED_CORNER9 = ('uicore_1_16_170', 7, -2)
FRAME_FILLED_SHADOW_CORNER0 = ('uicore_1_16_177', 7, -2)
FRAME_FILLED_SHADOW_CORNER1 = ('uicore_1_16_178', 7, -2)
FRAME_FILLED_SHADOW_CORNER2 = ('uicore_1_16_179', 7, -2)
FRAME_FILLED_SHADOW_CORNER3 = ('uicore_1_16_180', 7, -2)
FRAME_FILLED_SHADOW_CORNER4 = ('uicore_1_16_181', 7, -2)
FRAME_FILLED_SHADOW_CORNER5 = ('uicore_1_16_182', 7, -2)
FRAME_FILLED_SHADOW_CORNER6 = ('uicore_1_16_183', 7, -2)
FRAME_FILLED_SHADOW_CORNER7 = ('uicore_1_16_184', 7, -2)
FRAME_FILLED_SHADOW_CORNER8 = ('uicore_1_16_185', 7, -2)
FRAME_FILLED_SHADOW_CORNER9 = ('uicore_1_16_186', 7, -2)
FRAME_BORDER1_CORNER0 = ('uicore_1_16_193', 7, -2)
FRAME_BORDER1_CORNER1 = ('uicore_1_16_194', 7, -2)
FRAME_BORDER1_CORNER2 = ('uicore_1_16_195', 7, -2)
FRAME_BORDER1_CORNER3 = ('uicore_1_16_196', 7, -2)
FRAME_BORDER1_CORNER4 = ('uicore_1_16_197', 7, -2)
FRAME_BORDER1_CORNER5 = ('uicore_1_16_198', 7, -2)
FRAME_BORDER1_CORNER6 = ('uicore_1_16_199', 7, -2)
FRAME_BORDER1_CORNER7 = ('uicore_1_16_200', 7, -2)
FRAME_BORDER1_CORNER8 = ('uicore_1_16_201', 7, -2)
FRAME_BORDER1_CORNER9 = ('uicore_1_16_202', 7, -2)
FRAME_BORDER1_SHADOW_CORNER0 = ('uicore_1_16_209', 7, -2)
FRAME_BORDER1_SHADOW_CORNER1 = ('uicore_1_16_210', 7, -2)
FRAME_BORDER1_SHADOW_CORNER2 = ('uicore_1_16_211', 7, -2)
FRAME_BORDER1_SHADOW_CORNER3 = ('uicore_1_16_212', 7, -2)
FRAME_BORDER1_SHADOW_CORNER4 = ('uicore_1_16_213', 7, -2)
FRAME_BORDER1_SHADOW_CORNER5 = ('uicore_1_16_214', 7, -2)
FRAME_BORDER1_SHADOW_CORNER6 = ('uicore_1_16_215', 7, -2)
FRAME_BORDER1_SHADOW_CORNER7 = ('uicore_1_16_216', 7, -2)
FRAME_BORDER1_SHADOW_CORNER8 = ('uicore_1_16_217', 7, -2)
FRAME_BORDER1_SHADOW_CORNER9 = ('uicore_1_16_218', 7, -2)
FRAME_BORDER2_CORNER0 = ('uicore_1_16_225', 7, -2)
FRAME_BORDER2_CORNER1 = ('uicore_1_16_226', 7, -2)
FRAME_BORDER2_CORNER2 = ('uicore_1_16_227', 7, -2)
FRAME_BORDER2_CORNER3 = ('uicore_1_16_228', 7, -2)
FRAME_BORDER2_CORNER4 = ('uicore_1_16_229', 7, -2)
FRAME_BORDER2_CORNER5 = ('uicore_1_16_230', 7, -2)
FRAME_BORDER2_CORNER6 = ('uicore_1_16_231', 7, -2)
FRAME_BORDER2_CORNER7 = ('uicore_1_16_232', 7, -2)
FRAME_BORDER2_CORNER8 = ('uicore_1_16_233', 7, -2)
FRAME_BORDER2_CORNER9 = ('uicore_1_16_234', 7, -2)
FRAME_BORDER2_SHADOW_CORNER0 = ('uicore_1_16_241', 7, -2)
FRAME_BORDER2_SHADOW_CORNER1 = ('uicore_1_16_242', 7, -2)
FRAME_BORDER2_SHADOW_CORNER2 = ('uicore_1_16_243', 7, -2)
FRAME_BORDER2_SHADOW_CORNER3 = ('uicore_1_16_244', 7, -2)
FRAME_BORDER2_SHADOW_CORNER4 = ('uicore_1_16_245', 7, -2)
FRAME_BORDER2_SHADOW_CORNER5 = ('uicore_1_16_246', 7, -2)
FRAME_BORDER2_SHADOW_CORNER6 = ('uicore_1_16_247', 7, -2)
FRAME_BORDER2_SHADOW_CORNER7 = ('uicore_1_16_248', 7, -2)
FRAME_BORDER2_SHADOW_CORNER8 = ('uicore_1_16_249', 7, -2)
FRAME_BORDER2_SHADOW_CORNER9 = ('uicore_1_16_250', 7, -2)
EN_US_CANNOT_START_LINE = u' /\\-;:,'
EN_ADDITIONAL_VALID_CHARACTERS = u'\'"\x91\x92\x93\x94'
JA_OPENING_BRACKETS = u'\\(\\[\\{\uff08\uff5b\u3014\u3008\u300a\u300c\u300e\u3010\u3018\u3016\u301d\u2018\u201c\uff5f\xab'
JA_CLOSING_BRACKETS = u'\\)\\]\\}\uff09\uff5d\u3015\u3009\u300b\u300d\u300f\u3011\u3019\u3017\u301f\u2019\u201d\uff60\xbb'
JA_CHARACTERS = u'\u30fd\u30fe\u30fc\u30a1\u30a3\u30a5\u30a7\u30a9\u30c3\u30e3\u30e5\u30e7\u30ee\u30f5\u30f6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308e\u3095\u3096\u31f0\u31f1\u31f2\u31f3\u31f4\u31f5\u31f6\u31f7\u31f8\u31f9\u31fa\u31fb\u31fc\u31fd\u31fe\u31ff\u3005\u303b\uff67\uff68\uff69\uff6a\uff6b\uff6c\uff6d\uff6e\uff6f'
JA_HYPHENS = u'\u2010\u30a0\u2013\u301c\uff70'
JA_DELIMITERS = u'\\?\\!\uff1f\uff01\u203c\u2047\u2048\u2049'
JA_MID_SENTENCE_PUNCTUATION = u'\u30fb\u3001:;,'
JA_SENTENCE_ENDING_PUNCTUATION = u'\u3002\uff0e\\.'
JA_UNSEPARATABLE_CHARACTERS = u'\u2014\u2026\u2025\u3033\u3034\u3035'
JA_CANNOT_START_LINE = (((((JA_CLOSING_BRACKETS + JA_CHARACTERS) + JA_HYPHENS) + JA_DELIMITERS) + JA_MID_SENTENCE_PUNCTUATION) + JA_SENTENCE_ENDING_PUNCTUATION)
JA_CANNOT_END_LINE = JA_OPENING_BRACKETS
JA_DO_NOT_SPLIT = JA_UNSEPARATABLE_CHARACTERS
ZH_CN_CANNOT_START_LINE = u'\\!%\\),\\.:;>\\?\\]\\}\xa2\xa8\xb0\xb7\u02c7\u02c9\u2015\u2016\u2019\u201d\u201e\u201f\u2020\u2021\u203a\u2103\u2236\u3001\u3002\u3003\u3006\u3009\u300b\u300d\u300f\u3011\u3015\u3017\u301e\ufe35\ufe39\ufe3d\ufe3f\ufe43\ufe58\ufe5a\ufe5c\uff01\uff02\uff05\uff07\uff09\uff0c\uff0e\uff1a\uff1b\uff1f\uff3d\uff40\uff5c\uff5d\uff5e'
ZH_CN_CANNOT_END_LINE = u'\\$\\(\\[\\{\\*,<\xa3\xa5\xb7\u2018\u201c\u3008\u300a\u300c\u300e\u3010\u3014\u3016\u301d\ufe57\ufe59\ufe5b\uff04\uff08\uff0e\uff3b\uff5b\uffe1\uffe5'
KO_CANNOT_START_LINE = u'\\!%\\),\\.:;\\?\\]\\}\xa2\xb0\u2019\u201d\u2020\u2021\u2103\u3006\u3009\u300b\u300d\u300f\u3015\uff01\uff05\uff09\uff0c\uff0e\uff1a\uff1b\uff1f\uff3d\uff5d'
KO_CANNOT_END_LINE = u'\\$\\(\\[\\\\{\xa3\xa5\u2018\u201c\u3005\u3007\u3008\u300a\u300c\u300e\u3014\uff04\uff08\uff3b\uff5b\uffe5\uffe6#'
RU_ADDITIONAL_VALID_CHARACTERS = u'\u0301'
REGEX_CANNOT_START_LINE = (((EN_US_CANNOT_START_LINE + JA_CANNOT_START_LINE) + ZH_CN_CANNOT_START_LINE) + KO_CANNOT_START_LINE)
REGEX_CANNOT_END_LINE = ((JA_CANNOT_END_LINE + ZH_CN_CANNOT_START_LINE) + KO_CANNOT_END_LINE)
REGEX_DO_NOT_SPLIT = JA_DO_NOT_SPLIT
REGEX_ADDITIONAL_VALID_CHARACTERS = (EN_ADDITIONAL_VALID_CHARACTERS + RU_ADDITIONAL_VALID_CHARACTERS)
CJK_RANGE_START = u'\u2e80'
CJK_RANGE_END = u'\uffff'
CJK_NORMAL_CHARACTER_SET = util.RegexSubtractSet(CJK_RANGE_START, CJK_RANGE_END, ((REGEX_CANNOT_START_LINE + REGEX_CANNOT_END_LINE) + REGEX_DO_NOT_SPLIT))
WORD_BOUNDARY_REGEX = re.compile((((((((((((((((((((((((((((((u'([^' + REGEX_DO_NOT_SPLIT) + REGEX_CANNOT_START_LINE) + u'][') + REGEX_DO_NOT_SPLIT) + u']+[^') + REGEX_CANNOT_END_LINE) + u']|') + u'(?<!') + REGEX_DO_NOT_SPLIT) + u')[') + REGEX_CANNOT_END_LINE) + u']*') + CJK_NORMAL_CHARACTER_SET) + u'[') + REGEX_CANNOT_START_LINE) + u']*(?!') + REGEX_DO_NOT_SPLIT) + u')|') + u'(?<!') + REGEX_DO_NOT_SPLIT) + u')[') + REGEX_CANNOT_END_LINE) + u']*[\\w') + REGEX_ADDITIONAL_VALID_CHARACTERS) + ']+[') + REGEX_CANNOT_START_LINE) + u']*(?!') + REGEX_DO_NOT_SPLIT) + u'))'), re.UNICODE)
import triui
for (k, v,) in triui.__dict__.iteritems():
    if k.startswith('VK_'):
        locals()[k] = v

if ('VK_CONTROL' not in locals()):
    VK_CONTROL = 1
    VK_MENU = 2
    VK_SHIFT = 3
    VK_MBUTTON = 4
    VK_XBUTTON1 = 5
    VK_XBUTTON2 = 6
MODKEYS = (VK_CONTROL,
 VK_MENU,
 VK_SHIFT,
 VK_MBUTTON,
 VK_XBUTTON1,
 VK_XBUTTON2)
import uiutil
exports = uiutil.AutoExports('uiconst', locals())
exports.update({'uiconstLoaded.loaded': True})

